home *** CD-ROM | disk | FTP | other *** search
- /*
- * This is a mudlib file. Copy it to /obj/simul_efun.c, or
- * wherever the get_simul_efun() in master.c says.
- * The functions defined in this file should only be replacements of efuns
- * no longer supported. Don't use these functions any longer, use the
- * replacement instead.
- */
-
- #pragma strict_types
- #pragma save_types
-
- #if 0
- /*
- * The ls() function is no longer needed, as get_dir() can do the same
- * work.
- */
- void ls(string path) {
- int max, i, len, tmp;
- status trunc_flag;
- string *dir;
- #ifndef COMPAT_FLAG
- seteuid(geteuid(previous_object()));
- #endif
- /* dir = efun::get_dir(path); crashes the gd -- demos 911115 */
- dir = get_dir (path);
- #ifdef COMPAT_FLAG
- if (path[0] == '/')
- path = extract(path, 1);
- if (path != "")
- path += "/";
- #else
- if (path != "/")
- path += "/";
- #endif
- if (!dir) {
- write("No such directory.\n");
- return;
- }
- if (sizeof(dir) > 330)
- {
- dir = dir[0..329];
- trunc_flag = 1;
- }
- for (i=0; i < sizeof(dir); i++) {
- if (file_size(path + "/" + dir[i]) == -2)
- dir[i]+="/";
- len = strlen(dir[i]);
- if (len >= max)
- max = len+1;
- }
- if (max > 79)
- max = 79;
- for (i=0; i < sizeof(dir); i++) {
- string name;
- name = dir[i];
- tmp = strlen(name);
- if (len + tmp > 79) {
- len = 0;
- write("\n");
- }
- write(name);
- if (len + max > 80) {
- write("\n");
- len = 0;
- } else {
- write(extract(
- " ",
- 80-max+tmp));
- len += max;
- }
- }
- write("\n");
- if (trunc_flag) write("***TRUNCATED***\n");
- }
- #endif
-
- /*
- * The old 'slice_array' is no longer needed. Use range argument inside
- * a pair of brackets instead.
- */
- mixed *slice_array(mixed *arr, int from, int to) {
- return arr[from..to];
- }
-
- /*
- * filter_objects() has been renamed to filter_array().
- */
- mixed *filter_objects(mixed *list, string str, object ob, mixed extra) {
- return filter_array(list, str, ob, extra);
- }
-
- /*
- * query_snoop(). The old version had become somewhat to LPC-ish to
- * put in the GD, and is is not used that much (of course, the extra
- * check for the cloner does remain in the GD) - Zappa
- */
-
- object query_snoop(object ob)
- {
- int cg_level, victim_level;
- object snooper;
-
- if (!living(ob) || !query_ip_number(ob))
- return 0;
- cg_level = (int) this_player()->query_level();
- victim_level = (int) ob->query_level();
- if (!victim_level || !cg_level)
- return 0;
- if (cg_level <= victim_level)
- return 0;
- snooper = efun::query_snoop(ob);
- if (!snooper)
- return 0;
- if (snooper->query_arch() && cg_level < (int) snooper->query_level())
- return 0;
- return snooper;
- }
-